package com.hongdee.insurance.quotationitem.service;

import com.hongdee.insurance.order.entity.TInsuranceOrder;
import com.hongdee.insurance.quotationitem.entity.TInsuranceQuotationItem;

import java.util.List;
import java.util.Map;

/**
 * Created by Mr. Xu on 2017/4/27.
 */
public interface ITInsuranceQuotationItemService {
    /**
     * 根据报价单查询所有项目
     * @param uid
     * @param quotationId
     * @return
     * @throws Exception
     */
    public List QuotationItemList(String uid, String quotationId) throws Exception;

    /**
     * 退单选择保险项目
     * @param uid
     * @param quotationId
     * @param orderId
     * @return
     * @throws Exception
     */
    public List quotationItemReturnList(String uid,String quotationId,String orderId)throws Exception;

    /**
     * 计算保单未退项目的总保费信息
     * @param uid
     * @param quotationId
     * @param orderId
     * @return
     * @throws Exception
     */
    public Float quotationItemReturnSumPrice(String uid,String quotationId,String orderId)throws Exception;

    /**
     * 根据报价单ID 车辆ID 查询最近一个报报价单的保险项目信息
     * @param uid
     * @param carId
     * @return
     * @throws Exception
     */
    public List findQuotationItemListBylately(String uid,String carId,String key,List<String> itemList) throws Exception;


    /**
     * 新的公司与上一个报价单 保险单 验证模板是否一致
     * @param uid
     * @param carId
     * @param key
     * @param insuranceCompanyId
     * @return
     * @throws Exception
     */
    public List findQuotationItemListByLateLy(String uid,String carId,String key,String insuranceCompanyId) throws Exception;
    /**
     * 保存报价单项目
     *
     * @param data
     * @param uid
     * @return
     * @throws Exception
     */
    public void saveOrUpdate(List<Map<String,Object>> data,String QuotationId, String uid) throws Exception;
    /***
     * 所有保险项目
     * @return
     * @throws Exception
     */
    public List quotationList() throws  Exception;
    /**
     * 查询已有保险项目
     */
    public List hasQuotationList(String type ,String id)throws Exception;
    /**
     * 单条保险项目保存
     */
    public void singleSave(TInsuranceQuotationItem data, String uid) throws Exception;
    /**
     * 单条保险项目删除
     */
    public void singleDel(String id) throws Exception;


    /**
     * 根据交强或商业进行修改保险项目
     * @param data
     * @param QuotationId
     * @param uid
     * @param type
     * @throws Exception
     */
    public void updateItem(List<Map<String,Object>> data, String QuotationId, String uid,String type) throws Exception;

    /**
     * 根据报价单ID 获得交强险项目
     * @param quotationId
     * @return
     * @throws Exception
     */
    public List<Map<String,Object>> findQuotationJqItem(String quotationId) throws Exception;

    /**
     * 根据报价单ID 获得商业险项目
     * @param quotationId
     * @return
     * @throws Exception
     */
    public List<Map<String,Object>> findQuotationSyItem(String quotationId) throws Exception;

    /**
     * 检测 保险项目并返回保单类别
     * @param data
     * @return
     * @throws Exception
     */
    public String checkItems(List<Map<String,Object>> data) throws Exception;

    /**
     * 查询退单剩余的保险项目
     * @param oldOrder
     * @param type
     * @return
     * @throws Exception
     */
    public List surplusOrderItems(TInsuranceOrder oldOrder, String type) throws Exception;
}
